from django.contrib.auth.models import User
from rest_framework.serializers import ModelSerializer

from app_service.models.orm_model import Person, Worker, Farmer


class PersonSerializer(ModelSerializer):
    class Meta:
        model = Person
        fields = '__all__'


class WorkerSerializer(ModelSerializer):
    class Meta:
        model = Worker
        fields = '__all__'


class FarmerSerializer(ModelSerializer):
    class Meta:
        model = Farmer
        fields = '__all__'


class UserSerializer(ModelSerializer):
    class Meta:
        model = User
        fields = ['url', 'username', 'email', 'is_staff', ]
